package com.ljm.file.common;

import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * @author maist
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class EditorResponseDto implements Serializable {
    private Integer errno;
    private List<DetailDto> data;

    @Data
    @EqualsAndHashCode(callSuper = false)
    @Accessors(chain = true)
    @Builder
    public static class DetailDto implements Serializable{
        private String url;
        private String alt;
        private String href;

    }


    public static final class EditorResponseDtoBuilder {
        private Integer errno;
        private List<DetailDto> data;

        private EditorResponseDtoBuilder() {
        }

        public static EditorResponseDtoBuilder createEditorResponseDto() {
            return new EditorResponseDtoBuilder();
        }

        public EditorResponseDtoBuilder withErrno(Integer errno) {
            this.errno = errno;
            return this;
        }

        public EditorResponseDtoBuilder withData(List<DetailDto> data) {
            this.data = data;
            return this;
        }

        public EditorResponseDto build() {
            EditorResponseDto editorResponseDto = new EditorResponseDto();
            editorResponseDto.setErrno(errno);
            editorResponseDto.setData(data);
            return editorResponseDto;
        }
    }
}
